import time

from appium.webdriver.common.appiumby import By

from page.page01_index import app_index, search_index
from page.page02_login import app_login
from page.page03_order_purchase import buy_now_Payment
from tools import app_driver, driver_quit


def order_purchase_success():
    driver = app_driver()
    app_index(driver)
    # time.sleep(3)
    app_login(driver,"14000000000", "123456")
    search_index(driver, "小米8")
    buy_now_Payment(driver)
    information = driver.find_element(by=By.XPATH, value="//android.widget.TextView[@text='输入密码']").text
    assert "输入密码" == information
    driver_quit(driver)

if __name__ == '__main__':
    order_purchase_success()